# -*- encoding: utf-8 -*-
"""
@File    : homework.py
@Time    : 2020/10/24 18:12
@Author  : lluyao
@Email   : lluyao61@163.com
@Software: PyCharm
"""
'''
互送礼活动
圣诞节到了，公司开展一个互送礼物活动。每个员工系统会随机抽取一位送礼物的对
象，送礼对象不能重复。最终每个人都能送出和收到一份礼物。
·定义好公司员工名单
·循环系统会随机抽取一位收礼物的人
·打印最终的送礼和收礼的关系
'''
import random
students = ['a','b','c','d','e','f','g']
send_students = list(students)
receive_students = list(students)

while len(receive_students) != 0:
    num1 = random.randint(0,len(send_students)-1)
    name1 = send_students[num1]
    send_students.remove(name1)
    receive_students.remove(name1)
    num2 = random.randint(0,len(receive_students)-1)
    name2 = receive_students[num2]
    receive_students.remove(name2)
    receive_students.append(name1)
    print(f'{name1}送给{name2}')